﻿ 
using JshRCSWebApi.Service.ToolService;

namespace JshRCSWebApi.API.Controllers.Tool
{
    public class ToolController : BaseController
    {
        private readonly ToolService _toolService;
        public ToolController(IHttpContextAccessor httpContextAccessor,ToolService toolService) : base(httpContextAccessor)
        {
            this._toolService = toolService;
        }

        /// <summary>
        /// 图片上传
        /// </summary>
        /// <param name="image">图片</param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> UploadImage(IFormFile image)
            => await Task.Run(async () => await _toolService.UploadImage(image));

        /// <summary>
        /// 删除图片
        /// </summary>
        /// <param name="ID">站点类型ID</param>
        /// <returns></returns>
        [HttpDelete]
        public async Task<ApiResult> DeleteImageByID(long ID)
            => await _toolService.DeleteImageByID(ID);



    }
}
